﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Web.Caching;
using System.Collections.Generic;

using SalePartial.BLL;
using SalePartial.Model;

public partial class controls_front_JobPopu : System.Web.UI.UserControl
{
    //private SalePartial.BLL.JobBLL jobBll = JobBLL.Instance;
    private DateTime expireTime = DateTime.Now.AddMinutes(2);

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            bindJob();
        }
    }

    private void bindJob()
    {
        string cacheKey = "limitJobs";
        if (Cache[cacheKey] != null)
        {
            this.jobList.DataSource = (IEnumerable)Cache[cacheKey];
        }
        else
        {
            //List<JobInfo> list = jobBll.GetTopJobList(8);
            //Cache.Add(cacheKey, list, null, expireTime, TimeSpan.Zero, CacheItemPriority.High, null);
            //this.jobList.DataSource = list;
        }

        this.jobList.DataBind();
    }
}
